Right now, dhcpv6_pd_min_len is zero, meaning any request would be
accepted (as long as it fits what we have available).
That means that with a /56 (a common residential scenario), a downstream
router can request a /57 and gobble up 1/2 of the available address
space. Even a default dhcpv6_pd_min_len value of 60 means that we'd
support 15 PDs in total.
So let's err on the side of caution and set /62 as the default, people
who want larger allocations can easily override the default.
Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/357
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
| dhcpv6_na |bool | 1 | DHCPv6 stateful addressing hands out IA_NA - Internet Address - Network Address |
| dhcpv6_pd |bool | 1 | DHCPv6 stateful addressing hands out IA_PD - Internet Address - Prefix Delegation (PD) |
| dhcpv6_pd_preferred |bool | 0 | Set the DHCPv6-PD Preferred (P) flag in outgoing ICMPv6 RA message PIOs (RFC9762); requires `dhcpv6` and `dhcpv6_pd`. |
-| dhcpv6_pd_min_len |integer| - | Minimum prefix length to delegate with IA_PD (value is adjusted if needed to be greater than the interface prefix length). Range [1,64] |
+| dhcpv6_pd_min_len |integer| 62 | Minimum prefix length to delegate with IA_PD (adjusted, if necessary, to be longer than the interface prefix length). Range [1,64] |
| router |list |`<local address>`| IPv4 addresses of routers on a given subnet (provided via DHCPv4, should be in order of preference) |
| dns |list |`<local address>`| DNS servers to announce, accepts IPv4 and IPv6 |
| dnr |list |disabled| Encrypted DNS servers to announce, `<priority> <domain name> [<comma separated IP addresses> <SvcParams (key=value)>...]` |
#define HOSTID_LEN_MAX 64
#define HOSTID_LEN_DEFAULT HOSTID_LEN_MIN
-#define PD_MIN_LEN_MAX 64
+#define PD_MIN_LEN_MAX 64
+#define PD_MIN_LEN_DEFAULT 62
#define OAF_DHCPV6 (OAF_DHCPV6_NA | OAF_DHCPV6_PD)
iface->dhcpv6_assignall = true;
iface->dhcpv6_pd = true;
iface->dhcpv6_pd_preferred = false;
- iface->dhcpv6_pd_min_len = 0;
+ iface->dhcpv6_pd_min_len = PD_MIN_LEN_DEFAULT;
iface->dhcpv6_na = true;
iface->dhcpv6_hostid_len = HOSTID_LEN_DEFAULT;
iface->dns_service = true;